package com.lyz.dataStructure.algorithm.百度2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:21
 * @Description:
 **/

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/9/10 20:21
 *@Description:
 **/
public class 小度的部队 {
    static int shu = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n =sc.nextInt(),k=sc.nextInt();
        System.out.println(returnNum(n,k));
    }
    public  static  int returnNum(int m,int n){
        int i =1;
        boolean flag = false;
        while (i<=m){
            if((i+n)==(m-i)){
                flag = true;
                break;
            }else {
                i++;
            }
        }
        if(flag){
            returnNum((m-i),n);
            returnNum(i,n);
        }else {
            shu++;
        }
        return shu;
    }
}
